﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PriceScheme.aspx.cs" Inherits="Skyworth.CRM.Web.SalesManagement.PriceScheme" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>价格方案管理</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    <%--[if IE]>
     <link href="../themes/css/ieHack.css" rel="stylesheet" type="text/css" />
    <![endif]--%>
    <link href="../themes/default/style.css" rel="stylesheet" type="text/css" />
    <link href="../themes/css/core.css" rel="stylesheet" type="text/css" />
    <link href="../themes/css/pages.css" rel="stylesheet" type="text/css" />
    <link href="../themes/css/wbox.css" rel="stylesheet" type="text/css" />
    <link href="../themes/css/Messagebox.css" rel="stylesheet" type="text/css" />

    <script src="../javascripts/jquery-1.4.4.min.js" type="text/javascript"></script>

    <script src="../javascripts/dwz.core.js" type="text/javascript"></script>

    <script src="../javascripts/MessageBox.js" type="text/javascript"></script>

    <script src="../javascripts/dwz.pagination.js" type="text/javascript"></script>

    <script src="../javascripts/wbox.js" type="text/javascript"></script>

    <script src="../javascripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>

    <script src="../javascripts/jquery.autocomplete.js" type="text/javascript"></script>

    <link href="../javascripts/My97DatePicker/skin/WdatePicker.css" rel="stylesheet"
        type="text/css" />
    <style type="text/css">
        .content
        {
            overflow: auto;
            border: solid 1px #CCC;
            line-height: 21px;
            background: #FFF;
            padding: 2px;
        }
        .GridViewHeaderStyle th
        {
            background: url("../themes/default/images/grid/tableth.png") repeat-x scroll 0 0 #F0EFF0;
            padding: 2px;
            line-height: 21px;
            border-right: solid 1px #D0D0D0;
            border-bottom: solid 1px #D0D0D0;
            font-weight: bolder;
            height: 25px;
            width: auto;
            border-bottom: solid 1px #ededed;
            background-color: #F7F6F3;
            cursor: pointer;
            color: #333333;
            padding: 1px 2px;
            border-right: solid 1px #ededed;
        }
        .GridViewHeaderStyle
        {
            background: url("../themes/default/images/grid/tableth.png") repeat-x scroll 0 0 #F0EFF0;
            padding: 2px;
            line-height: 21px;
            border-right: solid 1px #D0D0D0;
            border-bottom: solid 1px #D0D0D0;
            font-weight: bolder;
            height: 25px;
            width: auto;
            border-bottom: solid 1px #ededed;
            background-color: #F7F6F3;
            cursor: pointer;
            color: #333333;
            padding: 1px 2px;
            border-right: solid 1px #ededed;
        }
        .GridViewRowStyle
        {
            background: url("../themes/default/images/grid/tableth.png") repeat-x scroll 0 0 #F0EFF0;
            padding: 2px;
            line-height: 21px;
            border-right: solid 1px #D0D0D0;
            border-bottom: solid 1px #D0D0D0;
            font-weight: bolder;
            height: 22px;
            width: auto;
            border-bottom: solid 1px #ededed;
            background-color: #F7F6F3;
            cursor: pointer;
            color: #333333;
            padding: 1px 2px;
            border-right: solid 1px #ededed;
        }
        .GridViewRowStyle td, .GridViewAlternatingRowStyle
        {
            border-right: solid 1px #ededed;
            overflow: hidden;
            padding: 0 3px;
            border-bottom: solid 1px #ededed;
            vertical-align: middle;
            line-height: 28px;
        }
        .GridViewSelectedRowStyle
        {
            background-color: #7cc5e5;
            border-color: #b8d0d6;
        }
    </style>

    <script type="text/javascript">
        var addWindow;
        var policyId=<%=PolicyId %>;
        
       $(document).ready(function() {
            $("#btnAdd").click(function() {
                if ($(this).attr("disabled") != "disabled") {
                    addWindow = $("#selectedId").wBox({ title: "新增价格方案", requestType: "iframe", target: "SelectProduct.aspx?Type=add&policyId="+policyId, iframeWH: { width: 590, height: 300} });
                    addWindow.showBox();
                }
                return false;
            })



        })
    
    </script>

</head>
<body style="background-color: #FFF">
    <form id="form1" runat="server">
    <div>
        <div style="margin: 2px;">
            <div class="panel" id="policyPanel">
                <div class="panelHeader">
                    <div class="panelHeaderContent">
                        <h1>
                            <span style="color: #FF0000; font-weight: bold">
                                <asp:Label ID="txtPolicyName" runat="server" Text=""></asp:Label></span>价格方案管理</h1>
                    </div>
                </div>
                <div class="panelContent">
                    <div class="content">
                        <table width="100%" id="policy">
                            <tr>
                                <td>
                                    <div class="searchBar" style="padding: 4px 5px;">
                                        <ul>
                                            <li style="float: left;"><span>价格方案名称：</span>
                                                <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
                                            </li>
                                            <li style="float: left; padding-left: 10px;"><span>价格方案编码：</span>
                                                <asp:TextBox ID="txtCode" runat="server"></asp:TextBox>
                                            </li>
                                            <li style="float: left; padding-left: 20px">
                                                <div class="buttonActive">
                                                    <div class="buttonContent">
                                                        <asp:Button ID="btnSearch" runat="server" Text="查询" ToolTip="查询价格方案信息" CssClass="serverButton"
                                                            OnClick="btnSearch_Click" />
                                                    </div>
                                                </div>
                                            </li>
                                            <br style="clear: both" />
                                        </ul>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div>
                                        <div class="panelBar">
                                            <ul class="toolBar">
                                                <li class="">
                                                    <asp:LinkButton ID="btnAdd" runat="server" CssClass="add"><span>添加价格方案</span> </asp:LinkButton></li>
                                                <li class="line">line</li>
                                                <li class="">
                                                    <input type="hidden" style="display: none;" id="selectedId" runat="server" />
                                                </li>
                                            </ul>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div style="_margin-top: -2px;">
                                        <div class="tableList">
                                            <table class="list" width="100%" id="pricePolicyTable">
                                                <asp:GridView ID="GridView1" runat="server" Width="100%" CellPadding="4" AutoGenerateColumns="False"
                                                    DataKeyNames="Id" AllowPaging="True" PageSize="12" OnRowCancelingEdit="GridView1_RowCancelingEdit"
                                                    OnRowEditing="GridView1_RowEditing" OnRowUpdating="GridView1_RowUpdating" OnRowDeleting="GridView1_RowDeleting"
                                                    OnRowDataBound="GridView1_RowDataBound" GridLines="None" OnPageIndexChanging="GridView1_PageIndexChanging">
                                                    <HeaderStyle CssClass="GridViewHeaderStyle" Height="25px" />
                                                    <SelectedRowStyle CssClass="GridViewSelectedRowStyle" />
                                                    <EditRowStyle BackColor="#999999" />
                                                    <RowStyle Height="23px" />
                                                    <Columns>
                                                        <asp:TemplateField HeaderText="价格方案编码">
                                                            <ItemTemplate>
                                                                <asp:Label ID="txtSchemeCode" Text='<%# Eval("SchemeCode") %>' runat="server" Width="100px"></asp:Label>
                                                            </ItemTemplate>
                                                            <ItemStyle Width="10%" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="价格方案名称">
                                                            <ItemTemplate>
                                                                <asp:Label ID="txtSchemeName" Text='<%# Eval("SchemeName") %>' runat="server" Width="120px"></asp:Label>
                                                            </ItemTemplate>
                                                            <ItemStyle Width="10%" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="价格类型">
                                                            <ItemTemplate>
                                                                <%# Eval("PriceTypeName")%>
                                                            </ItemTemplate>
                                                            <EditItemTemplate>
                                                                <asp:DropDownList ID="ddlPriceType" runat="server" Width="70px">
                                                                    <asp:ListItem Value="1">离岸价</asp:ListItem>
                                                                    <asp:ListItem Value="2">到岸价</asp:ListItem>
                                                                </asp:DropDownList>
                                                            </EditItemTemplate>
                                                            <ItemStyle Width="6%" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="不含税单价">
                                                            <ItemTemplate>
                                                                <%# Eval("Price")%>
                                                            </ItemTemplate>
                                                            <EditItemTemplate>
                                                                <asp:TextBox ID="txtPrice" Text='<%# Eval("Price") %>' runat="server" Width="60px" />
                                                            </EditItemTemplate>
                                                            <ItemStyle Width="6%" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="税率">
                                                            <ItemTemplate>
                                                                <%# Eval("TaxRatio")%>
                                                            </ItemTemplate>
                                                            <EditItemTemplate>
                                                                <asp:TextBox ID="txtTaxRatio" Text='<%# Eval("TaxRatio") %>' runat="server" Width="60px" />
                                                            </EditItemTemplate>
                                                            <ItemStyle Width="6%" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="含税单价">
                                                            <ItemTemplate>
                                                                <%# Eval("TaxPrice")%>
                                                            </ItemTemplate>
                                                            <EditItemTemplate>
                                                                <asp:TextBox ID="txtTaxPrice" Text='<%# Eval("TaxPrice") %>' runat="server" Width="60px" /><asp:RequiredFieldValidator
                                                                    ID="Rd2" runat="server" ErrorMessage="含税单价不能为空" ControlToValidate="txtTaxPrice"
                                                                    Display="Dynamic">*</asp:RequiredFieldValidator>
                                                                <asp:RegularExpressionValidator ID="rv2" runat="server" ErrorMessage="含税单必须是价整数或浮点数"
                                                                    ValidationExpression="^\d*$|[1-9]\d*\.\d*|0\.\d*[1-9]\d*$" ControlToValidate="txtTaxPrice"
                                                                    Display="Dynamic">*</asp:RegularExpressionValidator>
                                                            </EditItemTemplate>
                                                            <ItemStyle Width="6%" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="产品名称">
                                                            <ItemTemplate>
                                                                <asp:Label ID="txtProductName" Text='<%# Eval("ProductName") %>' runat="server" Width="100px" />
                                                            </ItemTemplate>
                                                            <ItemStyle Width="10%" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="开始时间">
                                                            <ItemTemplate>
                                                                <%# Eval("StartDate")%>
                                                            </ItemTemplate>
                                                            <EditItemTemplate>
                                                                <asp:TextBox ID="txtStartDate" Text='<%# Eval("StartDate") %>' runat="server" onClick="WdatePicker({skin:'ext',maxDate:''})"></asp:TextBox><asp:RequiredFieldValidator
                                                                    ID="rfv6" runat="server" ErrorMessage="不能为空" ControlToValidate="txtStartDate"
                                                                    Display="Dynamic" Text="*"></asp:RequiredFieldValidator>
                                                            </EditItemTemplate>
                                                            <ItemStyle Width="6%" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="结束时间">
                                                            <ItemTemplate>
                                                                <%# Eval("EndDate")%>
                                                            </ItemTemplate>
                                                            <EditItemTemplate>
                                                                <asp:TextBox ID="txtEndDate" Text='<%# Eval("EndDate") %>' runat="server" onClick="WdatePicker({skin:'ext',minDate:''})"></asp:TextBox><asp:RequiredFieldValidator
                                                                    ID="rfv7" runat="server" ErrorMessage="不能为空" ControlToValidate="txtEndDate" Display="Dynamic"
                                                                    Text="*"></asp:RequiredFieldValidator>
                                                            </EditItemTemplate>
                                                            <ItemStyle Width="6%" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="计入返利">
                                                            <ItemTemplate>
                                                                <%# Eval("SpecialTypeName")%>
                                                            </ItemTemplate>
                                                            <EditItemTemplate>
                                                                <asp:HiddenField ID="hideProductId" runat="server" Value='<%# Eval("ProductId") %>' />
                                                                <asp:DropDownList ID="ddlSpecialType" runat="server" Width="80px">
                                                                    <asp:ListItem Value="1">是</asp:ListItem>
                                                                    <asp:ListItem Value="0">否</asp:ListItem>
                                                                </asp:DropDownList>
                                                            </EditItemTemplate>
                                                            <ItemStyle Width="8%" />
                                                        </asp:TemplateField>
                                                        <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" HeaderText="操作" ItemStyle-Width="6%">
                                                            <ItemStyle Width="6%"></ItemStyle>
                                                        </asp:CommandField>
                                                    </Columns>
                                                </asp:GridView>
                                                <tbody>
                                                </tbody>
                                                <tfoot>
                                                </tfoot>
                                            </table>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="panelFooter">
                    <div class="panelFooterContent">
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div id="LoadingPanel" style="display: none;">
        <div id='background' class='background'>
        </div>
        <div id='progressBar' class='progressBar'>
            数据加载中，请稍等...</div>
    </div>
    </form>
</body>
</html>
